﻿using System;
using System.Collections.Generic;

namespace SR.ExpressionEvaluator.Lib.Core.Functions
{
    internal class Now : IFunction
    {
        List<object> _Args = new List<object>();

        public System.Collections.Generic.List<object> Args
        {
            get
            {
                return _Args;
            }
            set
            {
                _Args = value;
            }
        }

        public object Evaluate()
        {
            // No need to validate as a failed validation won't really affect the evaluation of this function
            return DateTime.Now;
        }

        public bool Validate()
        {
            if (Args.Count != 0)
            {
                return false;
            }
            return true;
        }

        public string GetDefinition()
        {
            return @"NOW()";
        }
    }
}
